package org.df.ulab.bot.plugins.xmpp;

import org.df.ulab.bot.api.message.ImMessage;
import org.df.ulab.bot.util.message.BaseMessage;
import org.jivesoftware.smack.packet.Presence;

/**
 * @author Daniel Filgueiras
 * @since 19/06/2011
 */
class XmppMessage extends BaseMessage implements ImMessage {

	public static final String PRESENCE_CHANGE = "[Presence]";
	private String	remoteId;
	
	public XmppMessage(String remoteId, CharSequence sequence) {
		super(new StringBuilder(sequence));
		this.remoteId = remoteId;
	}
	
	public XmppMessage(String remoteId, Presence presence) {
		super(PRESENCE_CHANGE);
		this.remoteId = remoteId;
	}
	
	public String getRemoteId() {
		return remoteId;
	}
	
	public XmppMessage replay(CharSequence sequence) {
		return new XmppMessage(this.remoteId, new StringBuilder(sequence));
	}
}
